<%--
  Created by IntelliJ IDEA.
  User: focus
  Date: 2018/1/6
  Time: 23:18
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ include file="../base.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <base href="<%=basePath%>">
    <meta content="text/html;charset=utf-8" http-equiv="Content-Type" />
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" name="viewport" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,Chrome=1" />
    <meta name="renderer" content="webkit" />
    <title>左玩玩，右玩玩。。 - WeCenter 社交化问答社区程序</title>
    <meta name="keywords" content="玩玩" />
    <meta name="description" content="左玩玩，右玩玩。。 - 左玩玩，右玩玩，转了好几个圈，发觉国内还是只有wecenter最好玩，只有wecenter是最用心做的，可惜这两年没更新了，哎！这么好的程序啊！"  />
    <link href="css/default/img/favicon.ico?v=20160523" rel="shortcut icon" type="image/x-icon" />

    <link rel="stylesheet" type="text/css" href="css/bootstrap.css" />
    <link rel="stylesheet" type="text/css" href="css/icon.css" />
    <link href="css/default/common.css?v=20160523" rel="stylesheet" type="text/css" />
    <link href="css/default/link.css?v=20160523" rel="stylesheet" type="text/css" />
    <link href="js/plug_module/style.css?v=20160523" rel="stylesheet" type="text/css" />

    <script type="text/javascript">
        var _26B4ED4A396A59B7A63C301B14A841C1="";
        var G_POST_HASH=_26B4ED4A396A59B7A63C301B14A841C1;
        var G_INDEX_SCRIPT = "";
        var G_SITE_NAME = "WeCenter 社交化问答社区程序";
        var G_BASE_URL = "http://wenda.wecenter.com";
        var G_STATIC_URL = "http://wenda.wecenter.com/static";
        var G_UPLOAD_URL = "http://wenda.wecenter.com/uploads";
        var G_USER_ID = "${sessionScope._current_user}";
        var G_USER_NAME = "";
        var G_UPLOAD_ENABLE = "N";
        var G_UNREAD_NOTIFICATION = 0;
        var G_NOTIFICATION_INTERVAL = 100000;
        var G_CAN_CREATE_TOPIC = "";
        var G_ADVANCED_EDITOR_ENABLE = "Y";
        var FILE_TYPES = "jpg,jpeg,png,zip,rar,7z";
    </script>

    <script src="js/jquery.2.js?v=20160523" type="text/javascript"></script>
    <script src="js/jquery.form.js?v=20160523" type="text/javascript"></script>
    <script src="js/plug_module/plug-in_module.js?v=20160523" type="text/javascript"></script>
    <script src="js/aws.js?v=20160523" type="text/javascript"></script>
    <script src="js/aw_template.js?v=20160523" type="text/javascript"></script>
    <script src="js/app.js?v=20160523" type="text/javascript"></script>
    <script src="js/editor/ckeditor/ckeditor.js?v=20160523" type="text/javascript"></script>
    <script src="js/editor/ckeditor/adapters/jquery.js?v=20160523" type="text/javascript"></script>
    <script type="text/javascript" src="js/compatibility.js"></script>
    <!--[if lte IE 8]>
    <script type="text/javascript" src="js/respond.js"></script>
    <![endif]-->
</head>
<noscript unselectable="on" id="noscript">
    <div class="aw-404 aw-404-wrap container">
        <img src="common/no-js.jpg">
        <p>你的浏览器禁用了JavaScript, 请开启后刷新浏览器获得更好的体验!</p>
    </div>
</noscript>
<body>
<%@ include file="../common/header.jsp"%>
<div class="aw-container-wrap">
    <div class="container">
        <div class="row">
            <div class="aw-content-wrap clearfix">
                <div class="col-sm-12 col-md-9 aw-main-content">
                    <!-- 话题推荐bar -->
                    <!-- 话题bar -->
                    <div class="aw-mod aw-topic-bar" id="question_topic_editor" data-type="question" data-id="${question.id}">
                        <div class="tag-bar clearfix">
                            <c:forEach var="t" items="${question.involvedTopics}">
                            <span class="topic-tag" data-id="${t.id}">
								<a href="topic/${t.id}" class="text">${t.topicName}</a>
							</span>
                            </c:forEach>
                        </div>
                    </div>
                    <!-- end 话题bar -->

                    <div class="aw-mod aw-question-detail aw-item">
                        <!-- 问题详情 -->
                        <div class="mod-head">
                            <h1>${question.title}</h1>
                            <c:if test="${sessionScope._current_user ne null}">
                                <c:if test="${!focus}">
                                    <div class="operate clearfix">
                                        <a href="javascript:void(0);" onclick="AWS.User.follow($(this), 'question', ${question.id});" class="follow btn btn-normal btn-success pull-left"><span>关注</span> <em>|</em> <b>${question.concernNumber}</b></a>
                                    </div>
                                </c:if>
                                <c:if test="${focus}">
                                    <div class="operate clearfix">
                                        <a href="javascript:void(0);" onclick="AWS.User.follow($(this), 'question', ${question.id});" class="follow btn btn-normal btn-success pull-left active"><span>取消关注</span> <em>|</em> <b>${question.concernNumber}</b></a>
                                    </div>
                                </c:if>
                            </c:if>
                        </div>
                        <div class="mod-body">
                            <div class="content markitup-box">
                                ${question.content}
                            </div>
                        </div>
                        <!-- end 问题详情 -->

                        <!-- 站内邀请 -->
                        <div class="aw-invite-box collapse">
                            <div class="mod-head clearfix">
                                <div class="search-box pull-left">
                                    <input id="invite-input" class="form-control" type="text"  placeholder="搜索你想邀请的人..."/>
                                    <div class="aw-dropdown">
                                        <p class="title">没有找到相关结果</p>
                                        <ul class="aw-dropdown-list"></ul>
                                    </div>
                                    <i class="icon icon-search"></i>
                                </div>
                                <div class="invite-list pull-left collapse">
                                    已邀请:
                                </div>
                            </div>
                        </div>
                        <!-- end 站内邀请 -->

                        <!-- 相关链接 -->
                        <div class="aw-question-related-box collapse">
                            <form action="http://wenda.wecenter.com/publish/ajax/save_related_link/" method="post" onsubmit="return false" id="related_link_form">
                                <div class="mod-head">
                                    <h2>与内容相关的链接</h2>
                                </div>
                                <div class="mod-body clearfix">
                                    <input type="hidden" name="item_id" value="31736" />
                                    <input type="text" class="form-control pull-left" name="link" value="" />
                                    <a onclick="AWS.ajax_post($('#related_link_form'));" class="pull-left btn btn-success">提交</a>
                                </div>
                            </form>
                        </div>
                        <!-- end 相关链接 -->
                    </div>

                    <div class="aw-mod aw-question-comment">
                        <div class="mod-head">
                            <ul class="nav nav-tabs aw-nav-tabs active">
                                <h2 class="hidden-xs">${question.answerCount} 个回复</h2>
                            </ul>
                        </div>
                        <div class="mod-body aw-feed-list">
                            <!-- 评论模块 -->
                            <c:forEach var="a" items="${question.answers}">
                            <div class="aw-item" uninterested_count="0" force_fold="0" id="answer_list_${a.id}">
                                <div class="mod-head">
                                    <a class="anchor" name="answer_${a.id}"></a>
                                    <!-- 用户头像 -->
                                    <a class="aw-user-img aw-border-radius-5" href="http://wenda.wecenter.com/people/%E6%AD%A5%E8%A1%8C%E8%80%85" data-id="${a.user.id}">
                                        <img src="http://wenda.wecenter.com/uploads/avatar/000/02/47/70_avatar_mid.jpg" alt="" />
                                    </a>
                                    <!-- end 用户头像 -->
                                    <div class="title">
                                        <p><a class="aw-user-name" href="http://wenda.wecenter.com/people/%E6%AD%A5%E8%A1%8C%E8%80%85" data-id="${a.user.id}">${a.user.username}</a></p>
                                    </div>
                                </div>
                                <div class="mod-body clearfix">
                                    <!-- 评论内容 -->
                                    <div class="markitup-box">
                                        ${a.answerContent}
                                    </div>
                                    <!-- end 评论内容 -->
                                </div>
                                <div class="mod-footer">
                                    <!-- 社交操作 -->
                                    <div class="meta clearfix">
                                        <span class="text-color-999 pull-right"><fmt:formatDate value="${a.createTime}" pattern="yyyy-MM-dd"/></span>
                                        <!-- 投票栏 -->
                                        <span class="operate">
                                        <c:if test="${sessionScope._current_user eq null}">
                                            <a class="agree disabled" ><i data-placement="right" title="" data-toggle="tooltip" class="icon icon-agree" data-original-title="赞同回复"></i> <b class="count">${a.agreeCount}</b></a>
                                        </c:if>
                                        <c:if test="${sessionScope._current_user ne null}">
                                            <a class="agree " onclick="AWS.User.agree_vote(this, '${user.username}', ${a.id});"><i data-placement="right" title="" data-toggle="tooltip" class="icon icon-agree" data-original-title="赞同回复"></i> <b class="count">${a.agreeCount}</b></a>
                                            <a class="disagree " onclick="AWS.User.disagree_vote(this, '${user.username}', ${a.id})"><i data-placement="right" title="" data-toggle="tooltip" class="icon icon-disagree" data-original-title="对回复持反对意见"></i></a>
                                        </c:if>
                                        </span>
                                        <!-- end 投票栏 -->
                                        <span class="operate">
                                            <a class="aw-add-comment" data-id="${a.id}" data-type="answer" data-comment-count="${a.commentCount}" data-first-click="collapse" href="javascript:void(0);"><i class="icon icon-comment"></i> ${a.commentCount}</a>
                                        </span>
                                    </div>
                                    <!-- end 社交操作 -->
                                </div>
                            </div>
                            </c:forEach>
                            <!-- end 评论模块 -->
                        </div>
                    </div>
                    <!-- end 问题详细模块 -->

                    <c:if test="${sessionScope._current_user eq null}">
                    <!-- 回复编辑器 -->
                    <div class="aw-mod aw-replay-box question">
                        <a name="answer_form"></a>
                        <p align="center">要回复问题请先<a href="user/login/">登录</a>或<a href="user/register/">注册</a></p>
                    </div>
                    </c:if>
                    <c:if test="${sessionScope._current_user ne null}">
                    <div class="aw-mod aw-replay-box question">
                        <a name="answer_form"></a>
                        <form action="question/ajax/save_answer" onsubmit="return false;" method="post" id="answer_form" class="question_answer_form">
                            <input type="hidden" name="question_id" value="${question.id}" />
                            <div class="mod-head">
                                <a href="http://wenda.wecenter.com/people/" class="aw-user-name"><img alt="FOCUS" src="http://wenda.wecenter.com/uploads/avatar/000/04/16/35_avatar_mid.jpg" /></a>
                                <p>
                                    <label class="pull-right"><a href="http://wenda.wecenter.com/integral/rule/" target="_blank">积分规则</a></label>
                                    ${user.username}
                                </p>
                            </div>
                            <div class="mod-body">
                                <div class="aw-mod aw-editor-box">
                                    <div class="mod-head">
                                        <div class="wmd-panel">
                                            <textarea class="wmd-input form-control autosize editor" id="wmd-input" rows="15" name="content"></textarea>
                                        </div>
                                    </div>
                                    <div class="mod-body clearfix">
                                        <a href="javascript:void (0);" onclick="AWS.ajax_post($('#answer_form'), AWS.ajax_processer, 'reply_question');" class="btn btn-normal btn-success pull-right btn-reply">回复</a>
                                        <span class="pull-right text-color-999" id="answer_content_message">&nbsp;</span>
                                    </div>
                                </div>

                            </div>
                        </form>
                    </div>
                    <!-- end 回复编辑器 -->
                    </c:if>
                </div>
                <!-- 侧边栏 -->
                <div class="col-md-3 aw-side-bar hidden-xs hidden-sm">
                    <!-- 发起人 -->
                    <div class="aw-mod">
                        <div class="mod-head">
                            <h3>发起人</h3>
                        </div>
                        <div class="mod-body">
                            <dl>
                                <dt class="pull-left aw-border-radius-5">
                                    <a href="http://wenda.wecenter.com/people/amao"><img alt="${question.user.username}" src="http://wenda.wecenter.com/uploads/avatar/000/00/68/72_avatar_mid.jpg" /></a>
                                </dt>
                                <dd class="pull-left">
                                    <a class="aw-user-name" href="http://wenda.wecenter.com/people/amao" data-id="${question.user.id}">${question.user.username}</a>
                                    <p></p>
                                </dd>
                            </dl>
                        </div>
                    </div>
                    <!-- end 发起人 -->

                    <!-- 问题状态 -->
                    <div class="aw-mod question-status">
                        <div class="mod-head">
                            <h3>问题状态</h3>
                        </div>
                        <div class="mod-body">
                            <ul>
                                <li>关注: <span class="aw-text-color-blue">${question.concernNumber}</span> 人</li>
                                <li class="aw-border-radius-5" id="focus_users"></li>
                            </ul>
                        </div>
                    </div>
                    <!-- end 问题状态 -->
                </div>
                <!-- end 侧边栏 -->
            </div>
        </div>
    </div>
</div>

<script type="text/javascript">
    var ATTACH_ACCESS_KEY = '26b4ed4a396a59b7a63c301b14a841c1';
    var ITEM_IDS = '';
    var COMMENT_UNFOLD = '';
    var QUESTION_ID = 31736;
    var UNINTERESTED_COUNT = 3;
    var ANSWER_EDIT_TIME = 640000;
    var USER_ANSWERED = '0';
    var UPLOAD_ENABLE = 'N';
    var ANSWER_TYPE = 'answer';
</script>
<script type="text/javascript" src="js/app/question_detail.js"></script>
<a class="aw-back-top hidden-xs" href="javascript:;" onclick="$.scrollTo(1, 600, {queue:true});"><i class="icon icon-up"></i></a>
<div id="aw-ajax-box" class="aw-ajax-box"></div>
</body>
</html>